home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / audacity / plug-ins / pluck.ny < prev    next >
Encoding:
Text File  |  2010-09-21  |  1.4 KB  |  34 lines

  1.  
  2. ;nyquist plug-in
  3. ;version 3
  4. ;type generate
  5. ;categories "http://lv2plug.in/ns/lv2core#GeneratorPlugin"
  6. ;name "Pluck..."
  7. ;action "Generating pluck sound..."
  8. ;info "modified by David R. Sky\nReleased under terms of the GNU General Public License version 2 \nMIDI values for C notes: 36, 48, 60 [middle C], 72, 84, 96."
  9.  
  10. ;control p "Pluck MIDI pitch" int "" 60 1 127
  11. ;control fade "Fade-out type" choice "abrupt,gradual" 0
  12. ;control dur "Duration [seconds]" real "" 1 0.1 30
  13.  
  14. ; original pluck.ny modified by David R.Sky October 2007
  15. ; [vastly simplified later]
  16. ; to give user option to use [default] abrupt or gradual fade-out,
  17. ; and ability to make pluck sound up to 30 seconds in duration.
  18. ; Modified January 2007 to use 'snd-pluck' by edgar-rft@web.de
  19. ; instead of the Nyquist 'pluck' function, and normalise to 0.8
  20. ; maximum amplitude. As defined in Audacity, 'pluck' has 
  21. ; incorrect length duration and clipping at the start which gives
  22. ; rise to DC offset. Using 'snd-pluck' avoids the clipping and 
  23. ; offset so we don't need the highpass8 filter that we used before.  
  24.  
  25.  
  26. ; set final-amp for abrupt or gradual fade
  27. (setf final-amp (if (= fade 1) 0.001 0.000001))
  28.  
  29. (let* ((pluck-sound (snd-pluck *sound-srate* (step-to-hz p) 0 dur final-amp))
  30.        (max-peak (peak pluck-sound ny:all)))
  31.   (scale (/ 0.8 max-peak) pluck-sound))  
  32.   
  33.   
  34. ;arch-tag: bebc6cb8-3bb0-42d5-a467-df6bd1a7f1e4